package com.kantboot.business.bp.service.impl;

import com.kantboot.business.bp.domain.entity.BusBpSubject;
import com.kantboot.business.bp.repository.BusBpSubjectRepository;
import com.kantboot.business.bp.service.IBusBpSubjectService;
import com.kantboot.system.user.domain.entity.SysUser;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusBpSubjectServiceImpl implements IBusBpSubjectService {

    @Resource
    private BusBpSubjectRepository repository;

    @Override
    public List<BusBpSubject> getAll() {
        return repository.findAll();
    }

    @Override
    public PageResult getBodyData(PageParam<SysUser> param) {
        Page<BusBpSubject> bodyData = repository.getBodyData(param.getPageable());
        return PageResult.of(bodyData);
    }
}
